<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html">



    <h:head>

    </h:head>

    <h:body>
        <ui:composition template="/resources/template/template.xhtml">
            <ui:define name="content">

                <h:panelGroup >
                    <h:form  >
                        <p:growl />
                        <p:panel header="Manage Discounts" >
                            <h:panelGroup rendered="#{!webUserController.hasPrivilege('Admin')}">
                                <h1>
                                    <h:outputLabel style="color: red;" value="You have NO privilege to manage discounts. Please discuss with the administrator." ></h:outputLabel>
                                </h1>
                            </h:panelGroup>

                            <p:tabView orientation="left"  rendered="#{webUserController.hasPrivilege('Admin')}">
                                <p:tab title="Discounts for Membershipd" >
                                    <p:panelGrid columns="1" >
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme" actionListener="#{membershipSchemeController.prepareAdd()}"  value="Membership Schemes" ajax="false" rendered="#{webUserController.hasPrivilege('MembershipSchemes')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme_payment_method_allowed" actionListener="#{membershipSchemeController.fillItems}" value="Allowed Payment Methods" ajax="false" rendered="#{webUserController.hasPrivilege('MembershipSchemes')}"/>                                       
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme_discount_inward" value="Inward Discounts for Memberships"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipInwardMemberShipSchemesDicounts')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme_discount_opd_by_department" value="OPD Discounts for Members by Department" actionListener="#{opdMemberShipDiscountController.recreateModel()}" ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByDepartment')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme_discount_opd_by_category" value="OPD Discounts for Members by Opd Category" actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByCategory')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/membership_scheme_discount_pharmacy_by_category" value="OPD Discounts for Members by Pharmaceutical Category " actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByCategory')}"/>

                                        <p:commandButton ajax="false" value="Channelling Discounts" 
                                                         action="#{opdMemberShipDiscountController.toManageDiscountMatrixForChannellingByDepartment()}"></p:commandButton>


                                    </p:panelGrid>
                                </p:tab>

                                <p:tab title="Discounts for Discount Schemes" >
                                    <p:panelGrid columns="1" >
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme" actionListener="#{paymentSchemeController.createPaymentSchemes()}" value="Discount Schemes" ajax="false" rendered="#{webUserController.hasPrivilege('MembershipSchemes')}"/>                                       
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_payment_method_allowed"   value="Allowed Payment Methods" ajax="false" rendered="#{webUserController.hasPrivilege('MembershipSchemes')}"/>                                       
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_discount_opd_by_department" value="Discount Scheme Discount by Department" actionListener="#{opdMemberShipDiscountController.recreateModel()}" ajax="false"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_discount_opd_by_category" value="Discount Scheme Discount by Opd Category" actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_discount_pharmacy_by_category" value="Discount Scheme Discount by Pharmacy Category " actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" />
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_discount_opd_by_item" value="Discount Scheme Discount by Item " actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" />
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_scheme_discount_channel"   value="Discount Scheme Discount for Channelling" ajax="false" rendered="#{webUserController.hasPrivilege('MembershipSchemes')}"/>   
                                    </p:panelGrid>
                                </p:tab>

                                <p:tab title="Discounts for Payment Method" >
                                    <p:panelGrid columns="1" >
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_method_discount_opd_by_department" value="Payment Method Discoun by Department" actionListener="#{opdMemberShipDiscountController.recreateModel()}" ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByDepartment')}"/>                                            
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_method_discount_opd_by_category" value="Payment Method Discoun by Opd Category" actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByCategory')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_method_discount_pharmacy_by_category" value="Payment Method Discoun by Pharmacy Category " actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByCategory')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/payment_method_discount_opd_by_item" value="Payment Method Discoun by Item " actionListener="#{opdMemberShipDiscountController.recreateModel()}"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisByCategory')}"/>
                                    </p:panelGrid>
                                </p:tab>

                                <p:tab title="Reports" >
                                    <p:panelGrid columns="1" >
                                        <p:commandButton styleClass="linkButton" action="/membership/report_inward" value="Inward MemberShip Report"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipInwardMemberShipInwardMemberShipReport')}"/>
                                        <p:commandButton styleClass="linkButton" action="/membership/report_opd" value="Opd MemberShip Report"  ajax="false" rendered="#{webUserController.hasPrivilege('MemberShipOpdMemberShipDisOpdMemberShipReport')}"/>
                                    </p:panelGrid>
                                </p:tab>

                            </p:tabView>




                        </p:panel>
                    </h:form>
                </h:panelGroup>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
